﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SampleLib
{
  public class ClassType
  {
    #region Members Variables
    private string m_Name = string.Empty;
    private int m_Value = int.MinValue;
    private object m_Obj = null;   
    #endregion

    #region Properties
    public string Name
    {
      get { return m_Name; }
      set { m_Name = value; }
    }
    public int Value
    {
      get { return m_Value; }
      set { m_Value = value; }
    }
    #endregion

    #region Ctor
    public ClassType()
      :this("DefaultName",0,null)
    {

    }
    public ClassType(string _Name,int _Value)
      :this(_Name,_Value,null)
    {

    }
    public ClassType(string _Name, int _Value,object _Obj)
    {
      m_Name = _Name;
      m_Value = _Value;
      m_Obj = _Obj;
    }
    #endregion

    #region Method
    //Attention au prefixe des methodes : Get retourne toujours une valeur - Set remplis toujours une valeur - Is retourne toujours un bool
    public int GetValueByName(string _Name)
    {
      int result = 0;//Toujours commencer par definir et setter la valeur de retour
      try
      {
        if (_Name == m_Name)
        {
          result = m_Value;
        }
      }
      catch (Exception)
      {
      }
      return result;
    }    
    #endregion
  }
}
